﻿/// A dictionary is stored as a sequence of text lines containing words and their explanations.
/// Write a program that enters a word and translates it by using the dictionary. 
/// Sample dictionary:
/// .NET - platform for applications from Microsoft
/// CLR - managed execution environment for .NET
/// namespace - hierarchical organization of classes


using System;
using System.Text.RegularExpressions;

class zad14
{
    static void Main()
    {
        string[] dictionary = {
            ".NET - platform for applications from Microsoft",
            "CLR - managed execution environment for .NET",
            "namespace - hierarchical - organization of classes"
        };

        string word = ".NET";

        
        foreach (string item in dictionary)
        {
            GroupCollection fragments = Regex.Match(item, "(.*?) - (.*)").Groups;

            if (fragments[1].Value == word)
            {
                Console.Write(fragments[1] + ": ");
                Console.Write(fragments[2]);
                Console.WriteLine();
                return;
            }
            
        }
    }

}

